package com.sz.common.pay.pingan.constant;

import com.sz.common.pay.common.PayProperties;
import com.sz.common.pay.common.PropertyName;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Function: 平安银行链接的配置信息 <br>
 *
 * @author: siqishangshu <br>
 * Date: 2017-10-31 10:58:00
 */

public final class Constant {
    public static final String IP_PORT_SPILT = ":";
    public static final String VALUE_NULL = "";
    public static final String CHARSET_GBK = PayProperties.getOrDefault(PropertyName.PA_SERVER_CHARSET, "gbk");
    public static final List HOSTS = PayProperties.getOrDefault(PropertyName.PA_SERVER_HOST, new ArrayList<>(Arrays.asList("120.132.124.147:7072")));
    public static final int MAX_CONN = PayProperties.getOrDefault(PropertyName.PA_SERVER_MAX_CON, 10);
    public static final double MAX_USEAGE = PayProperties.getOrDefault(PropertyName.PA_SERVER_MAX_USERAGE, 0.75);
    public static final int TIMEOUT = PayProperties.getOrDefault(PropertyName.PA_SERVER_TIMEOUT, 6000);
    public static final int BUFFER_SIZE = PayProperties.getOrDefault(PropertyName.PA_SERVER_BUFFER_SIZE, 4096);

    public static final String QYDM = PayProperties.getOrDefault(PropertyName.PA_PAY_QYDM, "3265");
    public static final String SUP_ACCT_ID = PayProperties.getOrDefault(PropertyName.SUP_ACCT_ID, "15000089773402");
    public static final String CHARSET_CODE = PayProperties.getOrDefault(PropertyName.CHARSET_CODE, "01");
    public static final String TARGET_SYSTEM = PayProperties.getOrDefault(PropertyName.TARGET_SYSTEM, "26");

    public static final String MESSAGE_VERSION = PayProperties.getOrDefault(PropertyName.MESSAGE_VERSION, "A001");
    public static final String COMMUNICATION_PROTOCOL_SERVER = PayProperties.getOrDefault(PropertyName.COMMUNICATION_PROTOCOL_SERVER, "01");
    public static final String COMMUNICATION_PROTOCOL_CLIENT = PayProperties.getOrDefault(PropertyName.COMMUNICATION_PROTOCOL_CLIENT, "01");
    public static final String TRADE_CODE = PayProperties.getOrDefault(PropertyName.TRADE_CODE, "000000");
    public static final List<String> B2BIPS = PayProperties.getOrDefault(PropertyName.PA_SERVER_HOST, new ArrayList<>(Arrays.asList("120.132.124.147")));
    public static final String TRAN_WEB_NAME = PayProperties.getOrDefault(PropertyName.TRAN_WEB_NAME, "三藏平台");
    public static final String NOTIFY_URL = PayProperties.getOrDefault(PropertyName.NOTIFY_URL, "/api/v1/pingan/notifyByBank");

    public static final String SUCCEED = "000000";
    public static final int SERVER_ERROR = 500;

    public static final String RECIVE_MESSAGE = "RecvMessage";
    public static final String BOBY_MSG = "BodyMsg";
    public static final String RSP_CODE = "RspCode";
    public static final String RSP_MSG = "RspMsg";
    public static final String RSP_TIME = "TranDateTime";
    public static final String RSP_LOG_NO = "ThirdLogNo";
    public static final String TRAN_FUNC = "TranFunc";
    public static final String MESSAGE_SPILT = "&";
    public static final String VAILD_PACKAGE = "com.sz.common.pay.pingan.entity";
    //跨行收款
    public static final String P2P_TYPE = "2" ;
    //操作长度
    public static final int THIRD_LOG_NO_LEN = 20;
    public static final String RSP_MSG_BAK = "RspMsgBak";
    //1：会员出金
    public static final String TRAN_OUT_TYPE = "1";

    /**
     * 银行类型	        BankType	C(1)	必输	    1：本行 2：他行
     */
    public class BankType {
        public static final String PINGAN = "1";
        public static final String OTHER = "2";
    }

    /**
     * 查询标志	    CardSelectFlag	C(1)	必输	1：全部会员 2：单个会员
     */
    public class CardSelectFlag {
        public static final String ALL = "1";
        public static final String ONE = "2";
    }

    /**
     * 查询标志	        BalanceSelectFlag	C(1)	必输	    2：普通会员子账号 3：功能子账号
     */
    public class BalanceSelectFlag {
        public static final String NUMBER_ACCOUNT = "2";
        public static final String FUNCTION_ACCOUNT = "3";
    }

    /**
     * 功能标志   	    TransactionFuncFlag   C(1)	必输	    "2：会员间交易 3：提现 4：充值"
     */
    public class TransactionFuncFlag {
        public static final String TRANSFER = "2";
        public static final String WITHDRWAL = "3";
        public static final String RECHARGE = "4";
    }

    /**
     * OnWayLiquidationResultsRequest 功能标志   TransactionFuncFlag	C(1)	必输	    1:全部，2：指定时间段
     */
    public class OnWayFuncFlag {
        public static final String ALL = "1";
        public static final String TIME_PERIOD = "2";
    }

    /**
     * 文件类型	    FileType	C(2)	必输	"充值文件-CZ 提现文件-TX 交易文件-JY 余额文件-YE"
     */
    public class FileType {
        public static final String RECHARGE = "CZ";
        public static final String WITHDRWAL = "TX";
        public static final String TRANSFER = "JY";
        public static final String BALANCE = "YE";
    }

    /**
     * 功能标志       	FuncFlag	C(1)	必输  	1:当日，2：历史
     */
    public class TimePeriodTransactionFuncFlag {
        public static final String NOW = "1";
        public static final String HISTORY = "2";
    }

    /**
     * 查询标志	        SelectFlag	C(1)	必输	    1：全部 2：转出 3：转入 
     */
    public class TimePeriodTransactionSelectFlag {
        public static final String ALL = "1";
        public static final String OUT = "2";
        public static final String IN = "3";
    }

    /**
     * 查询标志	        SelectFlag	C(1)	必输	    2：提现 3：清分
     */
    public class TimePeriodCashClearingSelectFlag {
        public static final String WITHDRWAL = "2";
        public static final String CLEAERING = "3";
    }

    /**
     * 功能标志       	FuncFlag	    C(1)	必输	    "2：平台代理确认收货（担保→收款方）3:平台代理申请退款（担保→付款方）"
     * Platform agent acknowledgement of receipt 2
     * Platform agent application refund        3
     */
    public class OrderManageMentFuncFlag {
        public static final String PLATFORM_AGENT_RECEIPT = "2";
        public static final String PLATFORM_AGENT_REFUND = "2";
    }

    /**
     * 功能标志	        FuncFlag	    C(1)	必输	    "1:开户3:销户"
     */
    public class OpenAcctFuncFlag {
        public static final String OPEN = "1";
        public static final String CLOSE = "3";
    }

    /**
     * 转账类型          WithdrawalTranType      C(1)    必须   "1：行内 3：行外"
     */
    public class WithdrawalTranType{
        public static final String Bank_Inter_Transfer = "1";
        public static final String Bank_Outer_Transfer = "3";
    }
}